#include "header.h"

class Masina{
	string culoare,carburant,imbunatatiri,tip;
	int cp,an_f,locuri;
	double motor;
	int pasageri; 
public:
	Masina(string,double,string,string,string,int,int,int);
	void coborare(int);
	void urcare(int);
};

Masina::Masina(string culoare="alb",double motor=1.0,string carburant="benzina",string imbunatatiri=" ",string tip="break",int cp=65,int an_f=2000,int locuri=5)
{
	this->culoare=culoare;
	this->motor=motor;
	this->carburant=carburant;
	this->imbunatatiri=imbunatatiri;
	this->tip=tip;
	this->cp=cp;
	this->an_f=an_f;
	this->locuri=locuri;
	this->pasageri=1;
}

void Masina::coborare(int nr)
{
	if(this->pasageri-nr>=1)
	{
		this->pasageri-=nr;
		cout<<"In masina mai sunt "<<this->pasageri<<" persoane.\n";
	}
	else cout<<"Numarul introdus este prea mare.\n";
}

void Masina::urcare(int nr)
{
	if(this->pasageri+nr<=this->locuri)
	{
		this->pasageri+=nr;
		cout<<"In masina sunt "<<this->pasageri<<" persoane.\n";
	}
	else cout<<"Nu sunt destule locuri.\n";
}

int main()
{
	Masina m,m1("rosu",3.0,"motorina"," ","berlina",90,2009,20);
	cout<<"m:\n";
	m.coborare(3);
	m.urcare(5);
	m.urcare(3);
	m.coborare(2);
	cout<<"m1:\n";
	m1.urcare(18);
	m1.coborare(3);
	m1.coborare(4);
	_getch();
	return 0;
}